package com.oocl.processdData.util;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Set;

import com.oocl.processdData.pojo.Customer;

public class PrinterUtil {
	
	
	public static void println(String msg){
		System.out.println(msg);
	}
	
	public static void println(Set<Customer> custs){
		System.out.println("\t\t"+"id"+"\t\t"+"name"+"\t\t"+"email"+"\t\t"+"sex"+"\t\t"+"birthday");
		for(Customer c:custs){
			System.out.println(c.toString());
		}
	}
	
	public static void println(String msg, OutputStream out) throws IOException {
		out.write(msg.getBytes());
	}

	public static void println(Collection<Customer> customers, OutputStream out) throws IOException {
		out.write(("\t\t"+"id"+"\t\t"+"name"+"\t\t"+"email"+"\t\t"+"sex"+"\t\t"+"birthday").getBytes());
		for(Customer cust:customers){
			out.write(cust.toString().getBytes());
		}
	}
}
